using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;

/**
*@file       GWUser_Enter_FailedSender.cs
*@brief      send message GWUser_Enter_Failed
*
*@author     graywind
*@version    1.0.0.1
*@data       2012/3/19
*/

//send message GWUser_Enter_Failed
public class msgGWUser_Enter_Failed
{
    public const int MessageId = (int)GatewayServerTypes.MessageType.GWUser_Enter_Failed;
    //TODO
	public int SessionId = NetLib.INVALID_SESSION;
	public gatewayserver.EnterFailed MsgContent = new gatewayserver.EnterFailed();
	/// <summary>
	/// Initializes a new instance of the <see cref="msgGWUser_Enter_Failed"/> class.
	/// </summary>
	/// <param name='session_id'>
	/// Session_id.
	/// </param>
	/// <param name='error'>
	/// Error.
	/// </param>
	public msgGWUser_Enter_Failed(int session_id, gatewayserver.EnterFailed.eErrorCode error)
	{
		SessionId = session_id;
		MsgContent.ErrorCode = error;
	}
}

//handle message
public partial class gwMessagePort
{
    /// <summary>
    /// handle message
    /// </summary>
    /// <param name="msg">message wrapper of GWUser_Enter_Failed</param>
    public static void ProcessMessage(msgGWUser_Enter_Failed msg)
    {
        //TODO
        //Main Message:  msgGatewayServer
		msgGatewayServer mainMsg = new msgGatewayServer(msg.SessionId, msgGWUser_Enter_Failed.MessageId, ProtoNet<gatewayserver.EnterFailed>.IntoBytes(msg.MsgContent));
		
		gwMessagePort.ProcessMessage(mainMsg);
    }
}
